

<div class="tab-pane fade" id="tab-tec">
  	<table class="table user-list" id="all-techs">
  		<thead>
  			<tr>
  				<th data-column-id="id"><span>ID</span></th>
  				<th data-column-id="tech_name" data-sortable="false"><span>技术名称</span></th>
  				<th data-column-id="description" data-formatter="description" data-sortable="false"><span>技术描述</span></th>
  				<th data-column-id="developer" data-sortable="false"><span>技术开发者</span></th>
  				<th data-column-id="efficiency" data-sortable="false"><span>节能效益</span></th>
  				<th data-column-id="verify_state" data-formatter="verifystate" data-sortable="false"><span>状态</span></th>
  				<th data-sortable="false" data-formatter="commands"><span>操作</span></th>
  			</tr>
  		</thead>
  		<tbody>
  		</tbody>
  	</table>
</div>


<script type="text/javascript">
var labelsSetting = {
	infos: "当前第 {{ctx.start}} 条 到 {{ctx.end}} 条 共 {{ctx.total}} 条数据",
	search: "搜索",
	loading: "正在加载...",
	noResults: "未找到您要的数据...",
	refresh: "刷新",
	all: "全部"
};

$("#showTech").click(function(){
  $("#all-techs").bootgrid({
    rowCount: [10, 25, 50],
      ajax:true,
      url: "get_user_tech?uid="+uid+"",
      labels:labelsSetting,
      formatters: {
        "commands": function(k,row){
          return '<a href="javascript:void(0);" tid="'+row.id+'" class="table-link doEdit"><span class="fa-stack"><i class="fa fa-square fa-stack-2x"></i><i class="fa fa-pencil fa-stack-1x fa-inverse"></i></span></a>' + '<a href="javascript:void(0);" tid="'+row.id+'" class="table-link doDetail"><span class="fa-stack"><i class="fa fa-square fa-stack-2x"></i><i class="fa fa-search-plus fa-stack-1x fa-inverse"></i></span></a>';
        },
        "description" : function(k, v){
          if(v.description.length > 20){
            return v.description.substr(0,19);
          }else{
            return v.description;
          }
        },
        "verifystate" :function(k, v){
          if(v.verify_state == 0){
            return "未审核";
          }
          if(v.verify_state == 1){
            return "已审核通过";
          }
          if(v.verify_state == 2){
            return "审核未通过";
          }
        }
      }
  }).on("loaded.rs.jquery.bootgrid", function (e)
      {
        $(".doEdit").bind('click',function(){
          var tid = $(this).attr('tid');
          window.location.href="../tech/edit_tech?tid="+tid;
        })

        $(".doDetail").bind("click", function(){
          var tid = $(this).attr("tid");
          window.location.href="../tech/detail_tech?tid="+tid;
        })
      });

  $(".input-group").hide();
  $(".btn-group").hide();
})



</script>